home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / Protracker v2.1a.adf / PT.FileFormat.txt < prev    next >
Text File  |  1992-04-13  |  4KB  |  118 lines

  1.  
  2. Protracker 2.1A Song/Module Format:
  3. -----------------------------------
  4.  
  5. Offset  Bytes  Description
  6. ------  -----  -----------
  7.    0     20    Songname. Remember to put trailing null bytes at the end...
  8.  
  9. Information for sample 1-31:
  10.  
  11. Offset  Bytes  Description
  12. ------  -----  -----------
  13.   20     22    Samplename for sample 1. Pad with null bytes.
  14.   42      2    Samplelength for sample 1. Stored as number of words.
  15.                Multiply by two to get real sample length in bytes.
  16.   44      1    Lower four bits are the finetune value, stored as a signed
  17.                four bit number. The upper four bits are not used, and
  18.                should be set to zero.
  19.                Value:  Finetune:
  20.                  0        0
  21.                  1       +1
  22.                  2       +2
  23.                  3       +3
  24.                  4       +4
  25.                  5       +5
  26.                  6       +6
  27.                  7       +7
  28.                  8       -8
  29.                  9       -7
  30.                  A       -6
  31.                  B       -5
  32.                  C       -4
  33.                  D       -3
  34.                  E       -2
  35.                  F       -1
  36.  
  37.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  38.   46      2    Repeat point for sample 1. Stored as number of words offset
  39.                from start of sample. Multiply by two to get offset in bytes.
  40.   48      2    Repeat Length for sample 1. Stored as number of words in
  41.                loop. Multiply by two to get replen in bytes.
  42.  
  43. Information for the next 30 samples starts here. It's just like the info for
  44. sample 1.
  45.  
  46. Offset  Bytes  Description
  47. ------  -----  -----------
  48.   50     30    Sample 2...
  49.   80     30    Sample 3...
  50.    .
  51.    .
  52.    .
  53.  890     30    Sample 30...
  54.  920     30    Sample 31...
  55.  
  56. Offset  Bytes  Description
  57. ------  -----  -----------
  58.  950      1    Songlength. Range is 1-128.
  59.  951      1    Well... this little byte here is set to 127, so that old
  60.                trackers will search through all patterns when loading.
  61.                Noisetracker uses this byte for restart, but we don't.
  62.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  63.                tells the tracker what pattern to play at that position.
  64. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  65.                inserted when they increased the number of samples from
  66.                15 to 31. If it's not there, the module/song uses 15 samples
  67.                or the text has been removed to make the module harder to
  68.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  69.  
  70. Offset  Bytes  Description
  71. ------  -----  -----------
  72. 1084    1024   Data for pattern 00.
  73.    .
  74.    .
  75.    .
  76. xxxx  Number of patterns stored is equal to the highest patternnumber
  77.       in the song position table (at offset 952-1079).
  78.  
  79. Each note is stored as 4 bytes, and all four notes at each position in
  80. the pattern are stored after each other.
  81.  
  82. 00 -  chan1  chan2  chan3  chan4
  83. 01 -  chan1  chan2  chan3  chan4
  84. 02 -  chan1  chan2  chan3  chan4
  85. etc.
  86.  
  87. Info for each note:
  88.  
  89.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  90. /                \ /      \  /                \ /      \
  91. 0000          0000-00000000  0000          0000-00000000
  92.  
  93. Upper four    12 bits for    Lower four    Effect command.
  94. bits of sam-  note period.   bits of sam-
  95. ple number.                  ple number.
  96.  
  97. Periodtable for Tuning 0, Normal
  98.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  99.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  100.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  101.  
  102. To determine what note to show, scan through the table until you find
  103. the same period as the one stored in byte 1-2. Use the index to look
  104. up in a notenames table.
  105.  
  106. This is the data stored in a normal song. A packed song starts with the
  107. four letters "PACK", and then comes the packed data.
  108.  
  109. In a module, all the samples are stored right after the patterndata.
  110. To determine where a sample starts and stops, you use the sampleinfo
  111. structures in the beginning of the file (from offset 20). Take a look
  112. at the mt_init routine in the playroutine, and you'll see just how it
  113. is done.
  114.  
  115. Lars "ZAP" Hamre /Amiga Freelancers
  116. Peter "CRAYON" Hanning /Mushroom Studios/Noxious
  117.  
  118.